package mhl.domain;

import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
import java.util.Date;

/**
 * id INT PRIMARY KEY AUTO_INCREMENT,
 * 		billId VARCHAR(50) NOT NULL DEFAULT '',
 * 		menuId INT NOT NULL DEFAULT 0,
 * 		nums INT NOT NULL DEFAULT 0,
 * 		diningTableId INT NOT NULL DEFAULT 0,
 * 		billDate DATE NOT NULL,
 * 		`status` VARCHAR(30) NOT NULL DEFAULT '未结账')
 */
public class bill {
    private Integer id;
    private String billId;
    private Integer menuId;
    private Integer nums;
    private Double money;
    private Integer diningTableId;
    private LocalDateTime billDate;
    private String status;
    private DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    public bill() {
    }

    public Integer getId() {
        return id;
    }

    public Double getMoney() {
        return money;
    }

    public void setMoney(Double money) {
        this.money = money;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getBillId() {
        return billId;
    }

    public void setBillId(String billId) {
        this.billId = billId;
    }

    public Integer getMenuId() {
        return menuId;
    }

    public void setMenuId(Integer menuId) {
        this.menuId = menuId;
    }

    public Integer getNums() {
        return nums;
    }

    public void setNums(Integer nums) {
        this.nums = nums;
    }

    public Integer getDiningTableId() {
        return diningTableId;
    }

    public void setDiningTableId(Integer diningTableId) {
        this.diningTableId = diningTableId;
    }

    public LocalDateTime getBillDate() {
        return billDate;
    }

    public void setBillDate(LocalDateTime billDate) {
        this.billDate = billDate;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return id + "\t\t\t"  + menuId + "\t\t\t" + nums + "\t\t" + money + "\t\t" + diningTableId
                + "\t\t" + billDate.format(formatter) + "\t\t" + status;
    }
}
